home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
fdmsrrc.igz
/
fdmsrrc.img
/
LEVEL3
/
msnet.cab
/
bin
/
msnet.bat
Wrap
DOS Batch File
|
2005-01-16
|
49KB
|
1,430 lines
@if "%debug%"=="" echo off
@if not "%debug%"=="" echo on
if "%1"==":" if not "%2"=="" goto %2
echo MSNET: Starting (version 2.7)
if not exist %ramdrv%\bin\lmod.com %0 : _error missing lmod.com (check utils.%arcext%)
if not exist %ramdrv%\bin\tfind.com %0 : _error missing tfind.com (check utils.%arcext%)
if not exist %ramdrv%\bin\wbat.com %0 : _error missing wbat.com (check utils.%arcext%)
:_start
xgrep -sy "^[:s]*@*[:s]*s?e?t?[:s]*[GP]_.+=" %ramdrv%\etc\global.set > %tmp%\_msnet.bak
if errorlevel 1 goto _noglob
xgrep -sy "^[:s]*@*[:s]*set[:s]+" %tmp%\_msnet.bak > %tmp%\_msnet.bat
xgrep -syv "^[:s]*@*[:s]*set[:s]+" %tmp%\_msnet.bak > %tmp%\_msnet.tmp
if errorlevel 1 goto _runset
lmod /L* set []< %tmp%\_msnet.tmp >> %tmp%\_msnet.bat
:_runset
call %tmp%\_msnet.bat
:_noglob
if "%g_timeout%"=="" set g_timeout=10
if exist protman$ goto _config2
if "%1"=="-c" goto _config1
if "%1"=="/c" goto _config1
if "%1"=="-h" goto _usage
if "%1"=="/h" goto _usage
if "%g_nocfg%"=="1" goto _nocfg
wbat box @%0:w_cfg #1,%g_timeout%
if errorlevel 3 goto _end
if errorlevel 2 goto _config1
:_nocfg
if not exist %ramdrv%\etc\profile\*.pro goto _nopro
if not "%g_fixpro%"=="1" goto _selprof
echo MSNET: Using fixed profile "%g_profile%"
if "%g_profile%"=="" goto _selprof
if not exist %ramdrv%\etc\profile\%g_profile%.pro goto _fnpro
if not "%g_bypro%"=="1" goto _bypro1
echo MSNET: You are forced to use fixed profile "%g_profile%"
goto _nchkpro1
:_bypro1
wbat box @%0:w_bypro #1,%g_timeout%
if errorlevel 100 goto _nopro
if errorlevel 3 goto _end
if errorlevel 2 goto _nopro
:_nchkpro1
goto _prorun2
:_fnpro
echo MSNET: Profile not found "%g_profile%" (%ramdrv%\etc\profile\%g_profile%.pro does not exist)
:_selprof
echo :_profile " Select profile " >%tmp%\_msnet.tmp
if exist %tmp%\_msnet2.tmp del %tmp%\_msnet2.tmp
for %%i in (%ramdrv%\etc\profile\*.pro) do echo %%i >>%tmp%\_msnet2.tmp
type %tmp%\_msnet2.tmp | lmod /L* /B\. [$4] >%tmp%\_msnet.bak
if exist %tmp%\_msnet2.tmp del %tmp%\_msnet2.tmp
:_dummy14
lmod /L* [~32][$1][~32][+][-]<%tmp%\_msnet.bak >%tmp%\_msnet2.tmp
if not "%g_profile%"=="" if exist %ramdrv%\etc\profile\%g_profile%.pro goto _pr1st
type %tmp%\_msnet2.tmp >%tmp%\_msnet.bak
goto _prlst
:_pr1st
tfind " %g_profile% " <%tmp%\_msnet2.tmp >%tmp%\_msnet.bak
tfind /v " %g_profile% " <%tmp%\_msnet2.tmp >>%tmp%\_msnet.bak
:_prlst
lmod set _msnet=[$1]<%tmp%\_msnet.bak >%tmp%\_msnet.bat
set _msnet=
call %tmp%\_msnet.bat
if "%_msnet%"=="" goto _prlopx
inifile %ramdrv%\etc\profile\%_msnet%.pro [] set p_prot | lmod /S [$2:!]>%tmp%\_msnet.bat
set p_prot=
call %tmp%\_msnet.bat
linex 1 <%tmp%\_msnet.bak >>%tmp%\_msnet.tmp
:_prdrop
set p_prot=
linex 2- <%tmp%\_msnet.bak >%tmp%\_msnet2.tmp
type %tmp%\_msnet2.tmp >%tmp%\_msnet.bak
goto _prlst
:_prlopx
if exist %tmp%\_msnet2.tmp del %tmp%\_msnet2.tmp
type %tmp%\_msnet.tmp | lmod /L3 set wbat=[$1]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
if not "%wbat%"=="" goto _proflist
type %tmp%\_msnet.tmp | lmod /L2 set wbat=[$1]>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
set g_profile=%wbat%
echo MSNET: Only one profile found (%g_profile%), no need for user to select...
:_bypass
if not "%g_bypro%"=="1" goto _bypro
echo MSNET: You cannot bypass profile "%g_profile%"
goto _nchkpro
:_bypro
wbat box @%0:w_bypro #1,%g_timeout%
if errorlevel 100 goto _nopro
if errorlevel 3 goto _end
if errorlevel 2 goto _nopro
:_nchkpro
goto _prorun2
:_proflist
tfind " %g_profile% " <%tmp%\_msnet.tmp >nul
if errorlevel 1 goto _prls1
@call w.bat list @%tmp%\_msnet.tmp:_profile #1,%g_timeout%
goto _prls2
:_prls1
@call w.bat list @%tmp%\_msnet.tmp:_profile
:_prls2
if errorlevel 100 goto _nopro
set g_profile=%wbat%
:_prorun2
:_dumdim4
xgrep -sy "^[:s]*@*[:s]*s?e?t?[:s]*.+=" < %ramdrv%\etc\profile\%g_profile%.pro > %tmp%\_msnet.bak
if errorlevel 1 goto _nopro
xgrep -sy "^[:s]*@*[:s]*set[:s]+" %tmp%\_msnet.bak > %tmp%\_msnet.bat
xgrep -syv "^[:s]*@*[:s]*set[:s]+" %tmp%\_msnet.bak > %tmp%\_msnet.tmp
if errorlevel 1 goto _runprof
lmod /L* set []< %tmp%\_msnet.tmp >> %tmp%\_msnet.bat
:_runprof
call %tmp%\_msnet.bat
:_nopro
if "%p_ip%"=="" set p_ip=0.0.0.0
if "%p_subnet%"=="" set p_subnet=0.0.0.0
if "%p_gway%"=="" set p_gway=0.0.0.0
if "%p_dns%"=="" set p_dns=0.0.0.0
if "%p_wins%"=="" set p_wins=0.0.0.0
if "%p_timeout%"=="" set p_timeout=5
if "%p_dhcp%"=="" set p_dhcp=1
if "%p_pkt%"=="" set p_pkt=1
if not exist %srcdrv%\lib\joinlib.%arcext% goto _nojoin
if not exist %ramdrv%\net\ndishlp.sys call %ramdrv%\bin\unpack.bat %srcdrv%\lib\joinlib.%arcext%
if not "%unpackerr%"=="" %0 : _error extracting '%srcdrv%\lib\joinlib.%arcext%'
:_nojoin
if exist %ramdrv%\net\ndishlp.sys goto _mscl1
if not exist %ramdrv%\net\ndishlp.sys call %ramdrv%\bin\unpack.bat %srcdrv%\lib\msclient.%arcext%
if not "%unpackerr%"=="" goto _abort
:_mscl1
if not "%p_nicmode%"=="4" goto _norm
set pci0=%p_nic%
goto _pciok
:_norm
set pci0=
if not exist %srcdrv%\lib\ndis\*.%arcext% goto _nondis
if not exist %ramdrv%\etc\_msnet.pci goto _bldnic
@rem if not exist %ramdrv%\etc\_msnet.nic goto _bldnic
if not exist %ramdrv%\etc\_msnet.crc goto _pre2
if not exist %ramdrv%\bin\crc32.com goto _bldnic
dir %srcdrv%\lib\ndis\*.%arcext% >%tmp%\_msnet.tmp
tfind "%arcext%" %tmp%\_msnet.tmp >%tmp%\_msnet.tm2
set w_crc=
type %ramdrv%\etc\_msnet.crc | lmod /L1 set w_crc=[$2] >%tmp%\_msnet.bat
call %tmp%\_msnet.bat
echo MSNET: Driver index CRC32 is %w_crc%, checking...
crc32 %tmp%\_msnet.tm2 %w_crc%
if errorlevel 1 if not "%p_nonicbld%"=="1" goto _bldnic
:_pre2
echo MSNET: Using pre-built driver index from drive %srcdrv%
if exist %ramdrv%\etc\_msnet.nic copy %ramdrv%\etc\_msnet.nic %tmp%
if exist %ramdrv%\etc\_msnet.pci copy %ramdrv%\etc\_msnet.pci %tmp%
if not exist %tmp%\_msnet.* goto _abort
@rem goto _nic2
if not exist %tmp%\_msnet.nic call %ramdrv%\bin\repci.bat %ramdrv%\etc\_msnet.pci %tmp%\_msnet.pci %tmp%\_msnet.nic
@rem :_norm2
if not exist %tmp%\_msnet.nic goto _bldnic
if not exist %tmp%\_msnet.pci goto _bldnic
goto _nic2
:_bldnic
echo MSNET: Building driver list from plug-ins
echo ; This file is used to manual>%tmp%\_msnet.nic
echo ; select a network driver>>%tmp%\_msnet.nic
echo :_ndis "Select Network driver..." [x]>>%tmp%\_msnet.nic
echo ; PCI map file (build from ndis.pci files)>%tmp%\_msnet.pci
for %%i in (%srcdrv%\lib\ndis\*.%arcext%) do call %0 : _addnic %%i
call %ramdrv%\bin\repci.bat %tmp%\_msnet.pci %tmp%\_msnet.pci %tmp%\_msnet.nic
echo MSNET: Generating 32 bits CRC
dir %srcdrv%\lib\ndis\*.%arcext% >%tmp%\_msnet.tmp
tfind "%arcext%" %tmp%\_msnet.tmp >%tmp%\_msnet.tm2
crc32 %tmp%\_msnet.tm2 >%tmp%\_msnet.crc
if "%p_nonicsav%"=="1" goto _gddjkl
if not exist %ramdrv%\bin\ettool.com goto _savdrv
%ramdrv%\bin\ettool.com -e -s
if errorlevel 255 goto _abort
if errorlevel 1 goto _oncd2
goto _savdrv
:_oncd2
echo MSNET: Booted from CD-Rom, where to put pre-built index?
wbat box @%0:w_ramdrv
if errorlevel 4 goto _nic2
if errorlevel 1 set wbat=%ramdrv%
if errorlevel 2 set wbat=a:
if errorlevel 3 set wbat=b:
:_oncd3
echo MSNET: Copying to %wbat%
if not exist %wbat%\etc\*.* mkdir %wbat%\etc
:_dummy85
for %%i in (%ramdrv%\etc\_msnet.*) do if exist %%i del %%i >nul
copy %tmp%\_msnet.pci %ramdrv%\etc
copy %tmp%\_msnet.crc %ramdrv%\etc
@rem copy %tmp%\_msnet.nic %wbat%\etc
copy %tmp%\_msnet.pci %wbat%\etc
copy %tmp%\_msnet.crc %wbat%\etc
goto _nic2
:_savdrv
echo MSNET: About to copying driver index to %srcdrv% for faster boot next time
echo MSNET: Skip this by hitting [Cancel] in the write protection dialog
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _nic2
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
:_dummy43
for %%i in (%srcdrv%\etc\_msnet.*) do if exist %%i del %%i >nul
:_gddjkl
for %%i in (%ramdrv%\etc\_msnet.*) do if exist %%i del %%i >nul
@rem copy %tmp%\_msnet.nic %ramdrv%\etc
copy %tmp%\_msnet.pci %ramdrv%\etc
copy %tmp%\_msnet.crc %ramdrv%\etc
if "%p_nonicsav%"=="1" goto _nic2
copy %tmp%\_msnet.pci %srcdrv%\etc
copy %tmp%\_msnet.crc %srcdrv%\etc
:_nic2
set pci0=
type %tmp%\_msnet.nic | lmod /L1 set wbat=[$1]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
if not "%wbat%"=="" goto _1nicok
echo MSNET: No network driver(s) found...
goto _abort
:_1nicok
type %tmp%\_msnet.nic | lmod /L2 set wbat=[$1]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
if not "%wbat%"=="" goto _2nicok
type %tmp%\_msnet.nic | lmod /L1 set wbat=[$1]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
echo MSNET: Auto selecting the only driver found (%wbat%)
set pci0=%wbat%
set wbat=
goto _pciok
:_2nicok
if "%p_nicmode%"=="2" goto _auto
if "%p_nicmode%"=="3" goto _manual
:_nicprompt
echo :w_auto "Auto detect PCI adapter?" [x]>%tmp%\_msnet.tmp
echo . (~press any key~: #? sec.)>>%tmp%\_msnet.tmp
if not exist %tmp%\_msnet.pci goto _nopci
echo [ Auto ] Autodetect your PCI network adapter.>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
:_nopci
if not exist %tmp%\_msnet.nic goto _noman
echo [ Manual ] Manual select your network adapter from a list.>>%tmp%\_msnet.tmp
echo . Use this for PCMCIA and ISA based adapters.>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
:_noman
if not exist %ramdrv%\bin\ettool.com goto _rebuild
%ramdrv%\bin\ettool.com -e -s
if errorlevel 255 goto _abort
if errorlevel 1 goto _oncd1
goto _rebuild
:_oncd1
:_rebuild
echo [ Rebuild ] Update the pre-built driver list on drive %srcdrv%.>>%tmp%\_msnet.tmp
echo . Use this if you have added/deleted some driver>>%tmp%\_msnet.tmp
echo . plug-in files.>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
:_norebld
echo [? Back ] Go back>>%tmp%\_msnet.tmp
call w.bat box @%tmp%\_msnet.tmp:w_auto #1,%p_timeout%
if errorlevel 100 goto _nmback
if "%wbat%"=="Auto" goto _auto
if "%wbat%"=="Manual" goto _manual
if "%wbat%"=="Rebuild" goto _bldnic
echo MSNET: w_auto value "%wbat%" not found
goto _abort
:_nmback
if not exist %ramdrv%\etc\profile\*.pro goto _end
goto _start
:_auto
echo MSNET: PCI Network adapter detection...
:_dumdim1
for %%i in (0 1 2 3 4) do set pci%%i=
if exist %ramdrv%\bin\getpci.exe if exist %ramdrv%\bin\repci.bat goto _getpci
if exist %ramdrv%\bin\pciscan.exe goto _pciscan
goto _manual
:_getpci
call repci.bat : _pnp %tmp%\_msnet.pci
goto _pcipnp
:_pciscan
pciscan.exe -s -u -d -x %tmp%\_msnet.pci
if errorlevel 1 goto _pcifailed
rem Workaround for DrDos
echo %pci0% * > %tmp%\_msnet.bak
lmod @set _msnet=[$1]< %tmp%\_msnet.bak > %tmp%\_msnet.bat
call %tmp%\_msnet.bat
if not "%_msnet%"=="" if not "%_msnet%"=="*" goto _pciok
if not exist %ramdrv%\bin\doenable.bat goto _tryisa
pciscan.exe -v | xgrep -s "[:s][:x]{4}[:s]" > %tmp%\_msnet.dev
tfind /e "cardbus" < %tmp%\_msnet.dev > nul
if errorlevel 1 goto _cardbus
tfind /e "pcmcia" < %tmp%\_msnet.dev > nul
if errorlevel 1 goto _cardbus
goto _tryisa
:_cardbus
call %ramdrv%\bin\doenable.bat
del %ramdrv%\bin\doenable.bat > nul
tfind "e100bodi" < %tmp%\_msnet.pci > nul
if errorlevel 1 goto _pciscan
tfind /v "ce100b32" < %tmp%\_msnet.pci > %tmp%\_msnet.tmp
type %tmp%\_msnet.tmp > %tmp%\_msnet.pci
goto _pciscan
:_tryisa
if "%p_noautoisa%"=="1" goto _0isa
tfind "dev=" < %tmp%\_msnet.pci | tfind /e "BAD " > nul
if errorlevel 2 goto _0isa
if errorlevel 1 goto _1isa
goto _0isa
:_1isa
tfind "=" < %tmp%\_msnet.pci > %tmp%\_msnet.bak
if exist %tmp%\_msnet.tmp del %tmp%\_msnet.tmp > nul
:_isalop
lmod [] < %tmp%\_msnet.bak >> %tmp%\_msnet.tmp
tfind "dev=" < %tmp%\_msnet.tmp | tfind /e "BAD " > nul
if errorlevel 1 goto _isaloop
linex 2- < %tmp%\_msnet.bak > %tmp%\_msnet.dum
type %tmp%\_msnet.dum > %tmp%\_msnet.bak
goto _isalop
:_isaloop
tfind "dev=" < %tmp%\_msnet.tmp | lmod [] | tfind /e "BAD " > nul
if errorlevel 1 goto _okisa
linex 2- < %tmp%\_msnet.tmp > %tmp%\_msnet.bak
type %tmp%\_msnet.bak > %tmp%\_msnet.tmp
goto _isaloop
:_okisa
tfind "ret=" < %tmp%\_msnet.tmp | lmod set wbat=[$2]> %tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
if "%wbat%"=="" goto _0isa
echo MSNET: No PCI match: Auto selecting single non-PCI driver (%wbat%)
set pci0=%wbat%
set wbat=
goto _pciok
:_0isa
echo MSNET: PCI detection has not found a listed PCI adapter. Switching to manual!
@rem pause
goto _manual
:_pcifailed
:_dumdim2
if exist %ramdrv%\bin\doenable.bat call %ramdrv%\bin\doenable.bat
if exist %ramdrv%\bin\doenable.bat del %ramdrv%\bin\doenable.bat >nul
echo MSNET: PCI detection has failed, Switching to manual!
:_manual
tfind /e ":_ndis" <%tmp%\_msnet.nic >nul
if errorlevel 1 goto _sgshsj
echo :_ndis "Select Network driver..." [x]>%tmp%\_msnet.tmp
type %tmp%\_msnet.nic >>%tmp%\_msnet.tmp
type %tmp%\_msnet.tmp >%tmp%\_msnet.nic
del %tmp%\_msnet.tmp >nul
:_sgshsj
type %tmp%\_msnet.nic | lmod /L* [1,76] >>%tmp%\_msnet.tmp
call w.bat list @%tmp%\_msnet.tmp:_ndis
if "%wbat%"=="" goto _nicprompt
echo %wbat% | lmod set pci0=[$1]>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
set wbat=
:_pciok
if "%pci1%"=="" goto _single
echo MSNET: Multiple network adapter detected, must select one to use.
echo :_pcix " Please select which adapter to use " [x]>>%tmp%\_msnet.tmp
if "%pci0%"=="" goto _pcix0
echo %pci0%|lmod /L1 Adapter [$1] Slot [$2] Bus [$3] Device [$4] >>%tmp%\_msnet.tmp
:_pcix0
if "%pci1%"=="" goto _pcix1
echo %pci1%|lmod /L1 Adapter [$1] Slot [$2] Bus [$3] Device [$4] >>%tmp%\_msnet.tmp
:_pcix1
if "%pci2%"=="" goto _pcix2
echo %pci2%|lmod /L1 Adapter [$1] Slot [$2] Bus [$3] Device [$4] >>%tmp%\_msnet.tmp
:_pcix2
if "%pci3%"=="" goto _pcix3
echo %pci3%|lmod /L1 Adapter [$1] Slot [$2] Bus [$3] Device [$4] >>%tmp%\_msnet.tmp
:_pcix3
if "%pci4%"=="" goto _pcix4
echo %pci4%|lmod /L1 Adapter [$1] Slot [$2] Bus [$3] Device [$4] >>%tmp%\_msnet.tmp
:_pcix4
call w.bat list @%tmp%\_msnet.tmp:_pcix #1,%p_timeout%
if errorlevel 100 goto _nicprompt
echo %wbat%|lmod /L1 set p_nic=[$2]>%tmp%\_msnet.bat
echo %wbat%|lmod /L1 set p_mnic=[$4] [$6] [$8]>>%tmp%\_msnet.bat
for %%i in (0 1 2 3 4) do set pci%%i=
call %tmp%\_msnet.bat
if not "%p_nic%"=="" goto _single2
echo MSNET: p_nic should not be empty at this point!
goto _abort
:_single
echo %pci0%| lmod /L1 set p_nic=[$1]>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
set pci0=
:_single2
echo MSNET: Extracting driver file "%p_nic%"
if not exist %ramdrv%\lib\ndis\%p_nic%.%arcext% goto _fromsrc
extract /y /l %ramdrv%\net\ /e %ramdrv%\lib\ndis\%p_nic%.%arcext%
if errorlevel 1 if not errorlevel 95 goto _abort
if not exist %ramdrv%\net\ndishlp.sys call %ramdrv%\bin\unpack.bat %srcdrv%\lib\msclient.%arcext%
if not "%unpackerr%"=="" goto _abort
goto _unpok
:_fromsrc
extract /y /l %ramdrv%\net\ /e %srcdrv%\lib\ndis\%p_nic%.%arcext%
if errorlevel 1 if not errorlevel 95 goto _abort
:_unpok
if not exist %ramdrv%\net\autorun.bat goto _noautorun
call %ramdrv%\net\autorun.bat
del %ramdrv%\net\autorun.bat
:_noautorun
goto _nicok
:_addnic
if exist %tmp%\ndis.isa del %tmp%\ndis.isa
if exist %tmp%\ndis.pci del %tmp%\ndis.pci
if exist %tmp%\ndis.txt del %tmp%\ndis.txt
extract /y /l %tmp%\ /e %3 ndis.*
if errorlevel 1 if not errorlevel 95 goto _abort
if not exist %tmp%\ndis.txt goto _ndistxt
type %tmp%\ndis.txt >>%tmp%\_msnet.nic
:_ndistxt
if not exist %tmp%\ndis.pci goto _ndispci
type %tmp%\ndis.pci >>%tmp%\_msnet.pci
:_ndispci
if not exist %tmp%\ndis.isa goto _ndisisa
type %tmp%\ndis.isa >>%tmp%\_msnet.pci
:_ndisisa
if exist %tmp%\ndis.isa del %tmp%\ndis.isa
if exist %tmp%\ndis.pci del %tmp%\ndis.pci
if exist %tmp%\ndis.txt del %tmp%\ndis.txt
goto _eof
:_nondis
echo MSNET: No driver files found on %srcdrv% (%srcdrv%\lib\ndis\*.%arcext%)
goto _abort
:_nicok
set w_netcard=
if exist %ramdrv%\net\%p_nic%.dos set w_netcard=%p_nic%.dos
if exist %ramdrv%\net\%p_nic%.exe set w_netcard=%p_nic%.exe
if not "%w_netcard%"=="" goto _drvok
echo MSNET: No driver found, %p_nic%.dos or %p_nic%.exe
goto _abort
:_drvok
if exist %ramdrv%\net\%p_nic%.ini goto _iniok
echo MSNET: Missing %p_nic%.ini
goto _abort
:_iniok
echo ; Protocol.ini generated by msnet.bat>%ramdrv%\net\protocol.ini
echo [network.setup]>>%ramdrv%\net\protocol.ini
echo version=0x3110>>%ramdrv%\net\protocol.ini
echo netcard=nu2$nic,1,NU2$NIC,1>>%ramdrv%\net\protocol.ini
if "%p_prot%"=="" goto _sprot
if "%p_prot%"=="msnetb" goto _protdone
if exist %srcdrv%\lib\%p_prot%.%arcext% goto _protdone
echo MSNET: Could not find needed file %srcdrv%\lib\%p_prot%.%arcext%...
echo.
@rem pause
:_sprot
echo :_prot "Select protocol">%tmp%\_msnet.tmp
if not exist %srcdrv%\lib\mstcp.%arcext% goto _nomstcp
echo TCP/IP>>%tmp%\_msnet.tmp
:_nomstcp
if not exist %srcdrv%\lib\msnwlink.%arcext% goto _nonwlink
echo NwLink (IPX/SPX)>>%tmp%\_msnet.tmp
:_nonwlink
echo Netbeui>>%tmp%\_msnet.tmp
type %tmp%\_msnet.tmp | lmod /L2 set wbat=[$1]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
if not "%wbat%"=="" goto _protok
echo MSNET: No protocol found...
goto _abort
:_protok
type %tmp%\_msnet.tmp | lmod /L3 set wbat=[]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
if not "%wbat%"=="" goto _protlist
type %tmp%\_msnet.tmp | lmod /L2 set wbat=[]>%tmp%\_msnet.bat
set wbat=
call %tmp%\_msnet.bat
echo MSNET: Only one protocol found, no need for user to select...
goto _protcmp
:_protlist
call w.bat list @%tmp%\_msnet.tmp:_prot #1,%p_timeout%
if "%wbat%"=="" goto _nicprompt
:_protcmp
set p_prot=
if "%wbat%"=="" goto _protsele
echo %wbat% | lmod set wbat=[$1][$2][$3][$4][$5][$6][$7][$8][$9][$10]>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
if "%wbat%"=="TCP/IP" set p_prot=mstcp
if "%wbat%"=="NwLink(IPX/SPX)" set p_prot=msnwlink
if "%wbat%"=="Netbeui" set p_prot=msnetb
if not "%p_prot%"=="" goto _protdone
:_protsele
echo MSNET: Protocol selection error...
goto _abort
:_protdone
echo MSNET: Using "%p_prot%" protocol
if not "%p_prot%"=="mstcp" goto _notcp
if not "%p_tcpwin%"=="1" goto _tcpwin
if "%p_dhcp%"=="1" goto _notcp
if "%p_ip%"=="" goto _tcpwin
if "%p_subnet%"=="" goto _tcpwin
goto _notcp
:_tcpwin
set wcb1=%p_dhcp%
set wcb2=%p_pkt%
call w.bat box @%0:w_tcp #1,%p_timeout%
set p_dhcp=%wcb1%
set p_pkt=%wcb2%
if errorlevel 3 goto _sprot
if errorlevel 2 goto _end
:_notcp
if "%p_mname%"=="" goto _newname
echo %p_mname%|lmod set tmachn=[1,3]>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
if "%tmachn%"=="PC-" goto _newname
goto _nameok
:_newname
echo.|time|lmod /L1 /S;:,.apm set p_mname=PC-[$!-2][$!-1][$!]>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
del %tmp%\_msnet.bat
:_nameok
set tmachn=
if "%p_wrkgrp%"=="" set p_wrkgrp=workgroup
if "%p_idwin%"=="1" goto _nobox
:_save
set wcb1=%w_pini%
set wcb2=%w_sini%
set wcb3=%w_elmhost%
if not "%p_user%"=="" call w.bat box @%0:w_param #1,%p_timeout%
if "%p_user%"=="" call w.bat box @%0:w_param
set w_pini=%wcb1%
set w_sini=%wcb2%
set w_elmhost=%wcb3%
@if not "%w_pass%"=="" set w_passwd=%w_pass%
@if not "%w_pass%"=="" set w_pass=
if errorlevel 5 goto _sprot
if errorlevel 4 goto _end
if errorlevel 3 goto _help
if errorlevel 2 goto _savpro
:_nobox
if "%p_wrkgrp%"=="" set p_wrkgrp=workgroup
if "%p_user%"=="" set p_user=none
:_nopasswd
if not "%p_prot%"=="mstcp" goto _skipip1
if exist %ramdrv%\net\tcpdrv.dos goto _tcpdrv1
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\mstcp.%arcext%
if not "%unpackerr%"=="" goto _abort
:_tcpdrv1
if not exist %ramdrv%\etc\lmhosts goto _g22w
type %ramdrv%\etc\lmhosts >%ramdrv%\net\lmhosts
:_g22w
if not exist %ramdrv%\etc\hosts goto _g11w
type %ramdrv%\etc\hosts >%ramdrv%\net\hosts
:_g11w
echo transport=tcpip,TCPIP>>%ramdrv%\net\protocol.ini
echo lana0=nu2$nic,1,tcpip>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [tcpip]>>%ramdrv%\net\protocol.ini
if not "%p_dhcp%"=="1" goto _nodhcp
echo @if "%%debug%%"=="" echo off>%ramdrv%\net\ipconfig.bat
echo ipconfg.exe %ramdrv%\net>>%ramdrv%\net\ipconfig.bat
:_nodhcp
if "%p_dhcp%"=="1" goto _dhcp1
if not "%p_ip%"=="" goto _ipaddr
echo MSNET: IP address cannot be empty, when DHCP is enabled
goto _abort
:_ipaddr
echo %p_ip% | lmod /S. set wbat=[$1] [$2] [$3] [$4]>%tmp%\_msnet.bat
if errorlevel 1 if not errorlevel 95 goto _abort
call %tmp%\_msnet.bat
echo ipaddress0=%wbat%>>%ramdrv%\net\protocol.ini
if not "%p_subnet%"=="" goto _subnt
echo MSNET: Subnetmask cannot be empty, when DHCP is enabled
goto _abort
:_subnt
echo %p_subnet% | lmod /S. set wbat=[$1] [$2] [$3] [$4]>%tmp%\_msnet.bat
if errorlevel 1 if not errorlevel 95 goto _abort
call %tmp%\_msnet.bat
echo subnetmask0=%wbat%>>%ramdrv%\net\protocol.ini
if "%p_gway%"=="" goto _nogatew
echo %p_gway% | lmod /S. set wbat=[$1] [$2] [$3] [$4]>%tmp%\_msnet.bat
if errorlevel 1 if not errorlevel 95 goto _abort
call %tmp%\_msnet.bat
echo defaultgateway0=%wbat%>>%ramdrv%\net\protocol.ini
:_nogatew
if "%p_wins%"=="" goto _nowins
echo %p_wins% | lmod /S. set wbat=[$1] [$2] [$3] [$4]>%tmp%\_msnet.bat
if errorlevel 1 if not errorlevel 95 goto _abort
call %tmp%\_msnet.bat
echo wins_server0=%wbat%>>%ramdrv%\net\protocol.ini
:_nowins
:_dhcp1
echo NBSessions=6>>%ramdrv%\net\protocol.ini
echo DriverName=TCPIP$>>%ramdrv%\net\protocol.ini
echo BINDINGS=NU2$NIC>>%ramdrv%\net\protocol.ini
echo LANABASE=0>>%ramdrv%\net\protocol.ini
if "%p_pkt%"=="1" goto _pkt
inifile %ramdrv%\net\system.ini [network drivers] "transport=tcpdrv.dos,nemm.dos"
if errorlevel 1 if not errorlevel 95 goto _abort
goto _pktdone
:_pkt
inifile %ramdrv%\net\system.ini [network drivers] "transport=tcpdrv.dos,nemm.dos,dis_pkt.dos"
if errorlevel 1 if not errorlevel 95 goto _abort
:_pktdone
if "%p_dhcp%"=="1" inifile %ramdrv%\net\protocol.ini [tcpip] "DisableDHCP=0"
if not "%p_dhcp%"=="1" inifile %ramdrv%\net\protocol.ini [tcpip] "DisableDHCP=1"
if errorlevel 1 if not errorlevel 95 goto _abort
:_skipip1
if not "%p_prot%"=="msnwlink" goto _skipnw1
if exist %ramdrv%\net\nwlink.exe goto _nwlink1
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\msnwlink.%arcext%
if not "%unpackerr%"=="" goto _abort
:_nwlink1
echo transport=nu2$nwlink,NU2$NWLINK>>%ramdrv%\net\protocol.ini
echo transport=nu2$ndishlp,NU2$NDISHLP>>%ramdrv%\net\protocol.ini
echo lana0=nu2$nic,1,nu2$nwlink>>%ramdrv%\net\protocol.ini
echo lana1=nu2$nic,1,nu2$ndishlp>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [NU2$NWLINK]>>%ramdrv%\net\protocol.ini
echo FRAME=ETHERNET_802.2>>%ramdrv%\net\protocol.ini
echo DriverName=nwlink$>>%ramdrv%\net\protocol.ini
echo BINDINGS=NU2$NIC>>%ramdrv%\net\protocol.ini
echo LANABASE=0>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [protman]>>%ramdrv%\net\protocol.ini
echo DriverName=PROTMAN$>>%ramdrv%\net\protocol.ini
echo PRIORITY=NU2$NDISHLP>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [NU2$NDISHLP]>>%ramdrv%\net\protocol.ini
echo DriverName=ndishlp$>>%ramdrv%\net\protocol.ini
echo BINDINGS=NU2$NIC>>%ramdrv%\net\protocol.ini
inifile %ramdrv%\net\system.ini [network drivers] "transport=ndishlp.sys"
if errorlevel 1 if not errorlevel 95 goto _abort
:_skipnw1
if not "%p_prot%"=="msnetb" goto _skipnb1
echo transport=nu2$ndishlp,NU2$NDISHLP>>%ramdrv%\net\protocol.ini
echo transport=nu2$netbeui,NU2$NETBEUI>>%ramdrv%\net\protocol.ini
echo lana0=nu2$nic,1,nu2$netbeui>>%ramdrv%\net\protocol.ini
echo lana1=nu2$nic,1,nu2$ndishlp>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [NU2$NETBEUI]>>%ramdrv%\net\protocol.ini
echo NCBS=8>>%ramdrv%\net\protocol.ini
echo SESSIONS=3>>%ramdrv%\net\protocol.ini
echo DriverName=netbeui$>>%ramdrv%\net\protocol.ini
echo BINDINGS=NU2$NIC>>%ramdrv%\net\protocol.ini
echo LANABASE=0>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [protman]>>%ramdrv%\net\protocol.ini
echo DriverName=PROTMAN$>>%ramdrv%\net\protocol.ini
echo PRIORITY=NU2$NDISHLP>>%ramdrv%\net\protocol.ini
echo.>>%ramdrv%\net\protocol.ini
echo [NU2$NDISHLP]>>%ramdrv%\net\protocol.ini
echo DriverName=ndishlp$>>%ramdrv%\net\protocol.ini
echo BINDINGS=NU2$NIC>>%ramdrv%\net\protocol.ini
inifile %ramdrv%\net\system.ini [network drivers] "transport=ndishlp.sys,*netbeui"
if errorlevel 1 if not errorlevel 95 goto _abort
:_skipnb1
if not "%p_prot%"=="mstcp" goto _nopkt2
if not "%p_pkt%"=="1" goto _nopkt2
echo.>>%ramdrv%\net\protocol.ini
echo [pktdrv]>>%ramdrv%\net\protocol.ini
echo DriverName=PKTDRV$>>%ramdrv%\net\protocol.ini
echo BINDINGS=NU2$NIC>>%ramdrv%\net\protocol.ini
echo intvec=0x60>>%ramdrv%\net\protocol.ini
echo chainvec=0x66>>%ramdrv%\net\protocol.ini
:_nopkt2
echo.>>%ramdrv%\net\protocol.ini
echo [NU2$NIC]>>%ramdrv%\net\protocol.ini
type %ramdrv%\net\%p_nic%.ini>>%ramdrv%\net\protocol.ini
if "%p_mnic%"=="" goto _nomnic
xgrep -sy devnum %ramdrv%\net\%w_netcard% >nul
if errorlevel 1 goto _0dvnm
goto _busdev
:_0dvnm
echo MSNET: Adding slot number to protocol.ini
:_sltxs
if "%p_slot%"=="" goto _normslt
if "%p_slot%"=="0" goto _nomnic
echo %p_slot% | lmod slot=[$1]>>%ramdrv%\net\protocol.ini
goto _nomnic
:_normslt
echo %p_mnic%|lmod /L1 slot=[$1]>>%ramdrv%\net\protocol.ini
goto _nomnic
:_busdev
echo MSNET: Adding busnum and devnum to protocol.ini
echo %p_mnic%|lmod /L1 busnum=[$2]>>%ramdrv%\net\protocol.ini
echo %p_mnic%|lmod /L1 devnum=[$3]>>%ramdrv%\net\protocol.ini
:_nomnic
inifile %ramdrv%\net\system.ini [network] "username=%p_user%"
if errorlevel 1 if not errorlevel 95 goto _abort
inifile %ramdrv%\net\system.ini [network] "workgroup=%p_wrkgrp%"
if errorlevel 1 if not errorlevel 95 goto _abort
if "%p_ntdom%"=="" goto _lm0
inifile %ramdrv%\net\system.ini [network] "lmlogon=1"
inifile %ramdrv%\net\system.ini [network] "logondomain=%p_ntdom%"
inifile %ramdrv%\net\system.ini [network] "preferredredir=full"
if errorlevel 1 if not errorlevel 95 goto _abort
goto _lmdone
:_lm0
inifile %ramdrv%\net\system.ini [network] "lmlogon=0"
inifile %ramdrv%\net\system.ini [network] "preferredredir=basic"
if errorlevel 1 if not errorlevel 95 goto _abort
:_lmdone
inifile %ramdrv%\net\system.ini [network] "computername=%p_mname%"
if errorlevel 1 if not errorlevel 95 goto _abort
inifile %ramdrv%\net\system.ini [network] "lanroot=%ramdrv%\net"
if errorlevel 1 if not errorlevel 95 goto _abort
inifile %ramdrv%\net\system.ini [network drivers] "netcard=%w_netcard%"
if errorlevel 1 if not errorlevel 95 goto _abort
inifile %ramdrv%\net\system.ini [network drivers] "devdir=%ramdrv%\net"
if errorlevel 1 if not errorlevel 95 goto _abort
if not "%p_user%"=="" inifile %ramdrv%\net\system.ini [Password Lists] "%p_user%=%ramdrv%\net\%p_user%.pwl"
if errorlevel 1 if not errorlevel 95 goto _abort
inifile %ramdrv%\net\system.ini [Password Lists] "*Shares=%ramdrv%\net\shares.pwl"
if errorlevel 1 if not errorlevel 95 goto _abort
if "%w_pini%"=="1" goto _editsome
if "%w_sini%"=="1" goto _editsome
if "%w_elmhost%"=="1" goto _editsome
goto _editnon
:_editsome
if exist %ramdrv%\bin\edit.com goto _editok
echo MSNET: Cannot edit the file you marked, %ramdrv%\bin\edit.com does not exist...
@rem pause
goto _editnon
:_editok
if "%w_pini%"=="1" edit %ramdrv%\net\protocol.ini
if "%w_sini%"=="1" edit %ramdrv%\net\system.ini
if "%w_elmhost%"=="1" edit %ramdrv%\net\lmhosts
:_editnon
if "%p_slow%"=="" goto _noslow
if exist %ramdrv%\bin\slowdown.com %ramdrv%\bin\slowdown /d /v /p:%p_slow%
:_noslow
if exist %ramdrv%\lib\ndis\*.%arcext% del %ramdrv%\lib\ndis\*.%arcext%
set path=%ramdrv%\net;%path%
%ramdrv%
if "%p_pause%"=="1" pause
cd \net
if not "%p_prot%"=="mstcp" goto _skipip2
if .%p_netlow%.==.1. if "%os%"=="fd" goto _netfd
echo MSNET: Network initializing
net init
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading NETBIND
netbind
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading high UMB
%ldh% umb
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading high TCPTSR
%ldh% tcptsr
if errorlevel 1 if not errorlevel 95 goto _abort
goto _netfd2
:_netfd
echo MSNET: Network initializing (freedos - loading low)
loadhigh /L: net init
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading NETBIND
netbind
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading high UMB
%ldh% umb
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading TCPTSR
tcptsr
if errorlevel 1 if not errorlevel 95 goto _abort
:_netfd2
if not "%p_dhcp%"=="1" goto _dhcp2
%ramdrv%\net\ipconfg.exe %ramdrv%\net | tfind "Domainname" >%tmp%\_msnet.tmp
type %tmp%\_msnet.tmp | lmod /S: set p_domain=[$2] >%tmp%\_msnet.bat
%ramdrv%\net\ipconfg.exe %ramdrv%\net | tfind "Primary DNS Server" >%tmp%\_msnet.tmp
type %tmp%\_msnet.tmp | lmod /S: set p_dns=[$4] >>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
:_dhcp2
if "%p_dns%"=="" goto _nodns
echo %p_dns% | lmod /S. set wbat=[$1] [$2] [$3] [$4]>%tmp%\_msnet.bat
if errorlevel 1 if not errorlevel 95 goto _abort
call %tmp%\_msnet.bat
inifile %ramdrv%\net\tcputils.ini [dnr] "nameserver0=%wbat%"
if errorlevel 1 if not errorlevel 95 goto _abort
:_nodns
if "%p_domain%"=="" goto _nodomsuf
if "%p_dhcp%"=="1" goto _fsdget
echo echo . DNS suffix : %p_domain% >>%ramdrv%\net\ipconfig.bat
:_fsdget
inifile %ramdrv%\net\tcputils.ini [dnr] "domain=%p_domain%"
if errorlevel 1 if not errorlevel 95 goto _abort
:_nodomsuf
echo MSNET: Creating WATTCP.CFG file
echo # Barts Network boot disk>%ramdrv%\net\wattcp.cfg
echo # Waterloo TCP/IP configuration file>>%ramdrv%\net\wattcp.cfg
echo print = "Barts Network boot disk - Waterloo TCP/IP setup">>%ramdrv%\net\wattcp.cfg
if "%p_dhcp%"=="1" goto _watdhcp
echo my_ip = %p_ip%>>%ramdrv%\net\wattcp.cfg
goto _watdhc2
:_watdhcp
echo my_ip = dhcp>>%ramdrv%\net\wattcp.cfg
:_watdhc2
echo hostname = %p_mname%>>%ramdrv%\net\wattcp.cfg
echo netmask = %p_subnet%>>%ramdrv%\net\wattcp.cfg
echo nameserver = %p_dns%>>%ramdrv%\net\wattcp.cfg
echo gateway = %p_gway%>>%ramdrv%\net\wattcp.cfg
echo domain_list = %p_domain%>>%ramdrv%\net\wattcp.cfg
set wattcp.cfg=%ramdrv%\net
if "%p_dhcp%"=="1" goto _noipcfg
echo @if "%%debug%%"=="" echo off >%ramdrv%\net\ipconfig.bat
echo echo.>>%ramdrv%\net\ipconfig.bat
echo echo IP configuration:>>%ramdrv%\net\ipconfig.bat
echo echo . Host Name............... : %p_mname%>>%ramdrv%\net\ipconfig.bat
echo echo . DNS Server.............. : %p_dns%>>%ramdrv%\net\ipconfig.bat
echo echo . Domain Suffix........... : %p_domain%>>%ramdrv%\net\ipconfig.bat
if "%p_pkt%"=="1" goto _ippkt
echo echo . Packet Driver Interface. : No>>%ramdrv%\net\ipconfig.bat
goto _ippkt2
:_ippkt
echo echo . Packet Driver Interface. : Yes>>%ramdrv%\net\ipconfig.bat
:_ippkt2
echo echo.>>%ramdrv%\net\ipconfig.bat
echo echo Adapter %p_nic%:>>%ramdrv%\net\ipconfig.bat
echo echo . IP Address.............. : %p_ip% >>%ramdrv%\net\ipconfig.bat
echo echo . Subnet Mask............. : %p_subnet% >>%ramdrv%\net\ipconfig.bat
echo echo . Default Gateway......... : %p_gway% >>%ramdrv%\net\ipconfig.bat
:_noipcfg
echo MSNET: loading TINYRFC
tinyrfc
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading NMTSR
nmtsr
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading high EMSBFR
%ldh% emsbfr
if errorlevel 1 if not errorlevel 95 goto _abort
if "%p_dhcp%"=="1" goto _dns2
if "%p_dns%"=="" goto _nodns2
:_dns2
echo MSNET: loading DNR
dnr.exe
:_nodns2
:_skipip2
if not "%p_prot%"=="msnwlink" goto _skipnw2
net init
if errorlevel 1 if not errorlevel 95 goto _abort
echo MSNET: loading high NWLINK
%ldh% nwlink.exe
if errorlevel 1 if not errorlevel 95 goto _abort
:_skipnw2
echo MSNET: Starting network services
net start workstation
if errorlevel 1 if not errorlevel 95 goto _abort
:_logon
if exist %ramdrv%\bin\mac.bat call %ramdrv%\bin\mac.bat
if "%macaddr%"=="" goto _noea
if "%macaddr8%"=="" goto _noea1
echo MSNET: Your MAC Address: %macaddr% (%macaddr8%)
goto _noea
:_noea1
echo MSNET: Your MAC Address: %macaddr%
:_noea
if not exist %ramdrv%\etc\halt.txt if not exist %ramdrv%\etc\stop.txt goto _ndelthe
if "%ipaddr8%"=="" if "%macaddr8%"=="" goto _ndelthe
if not "p_chkpc"=="1" if not "%macaddr8%"=="" if exist %srcdrv%\etc\%macaddr8%.no goto _hlthalt
if not "p_chkpc"=="0" if not "%ipaddr8%"=="" if exist %srcdrv%\etc\%ipaddr8%.no goto _hlthalt
if not "p_chkpc"=="1" if not "%macaddr8%"=="" if exist %srcdrv%\etc\%macaddr8%.yes goto _ndelthe
if not "p_chkpc"=="0" if not "%ipaddr8%"=="" if exist %srcdrv%\etc\%ipaddr8%.yes goto _ndelthe
if not "p_chkpc"=="1" if not "%macaddr8%"=="" if exist %srcdrv%\etc\%macaddr8%.___ goto _hltmac
if not "p_chkpc"=="0" if not "%ipaddr8%"=="" if exist %srcdrv%\etc\%ipaddr8%.___ goto _hltip
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 %0 : _error Could not imprint MAC/IP on '%srcdrv%'
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc >nul
for %%i in (%srcdrv%\etc\*.___) do if exist %%i del %%i
if exist %srcdrv%\etc\*.___ %0 : _error Could not delete '%srcdrv%\etc\*.___'
if "%macaddr8%"=="" goto _noea21
echo %macaddr8% >%tmp%\_msnet.bak
tfind "z" <%tmp%\_msnet.bak >%srcdrv%\etc\%macaddr8%.___
if not exist %srcdrv%\etc\%macaddr8%.___ %0 : _error Could not create '%srcdrv%\etc\%macaddr8%.___'
:_noea21
if "%ipaddr8%"=="" goto _noei21
echo %ipaddr8% >%tmp%\_msnet.bak
tfind "z" <%tmp%\_msnet.bak >%srcdrv%\etc\%ipaddr8%.___
if not exist %srcdrv%\etc\%ipaddr8%.___ %0 : _error Could not create '%srcdrv%\etc\%ipaddr8%.___'
:_noei21
goto _ndelthe
:_hltmac
:_hltip
if exist %ramdrv%\etc\halt.txt goto _hlthalt
if exist %ramdrv%\etc\stop.txt goto _hltstop
:_hlthalt
call %ramdrv%\bin\halt.bat halt
if exist %ramdrv%\halt.txt goto _end
goto _end
:_hltstop
call %ramdrv%\bin\halt.bat stop
if exist %ramdrv%\halt.txt goto _end
if exist %ramdrv%\halt.txt goto _end
:_ndelthe
echo MSNET: Network logon as "%p_user%"
if "%p_user%"=="*" goto _noprf1
if "%p_user%"=="!" goto _noprf1
if not "%p_user%"=="" net logon %p_user% %w_passwd% /yes /savepw:no
if errorlevel 1 pause
set PCNAME=%p_mname%
set prompt=%p_user%@%p_mname% $p$g
if exist %tmp%\_msnetx.bat del %tmp%\_msnetx.bat
if not exist %ramdrv%\etc\autoexec.net goto _noautonet
echo MSNET: %ramdrv%\etc\autoexec.net found
type %ramdrv%\etc\autoexec.net >>%tmp%\_msnetx.bat
:_noautonet
if "%g_profile%"=="" goto _noprf1
if not exist %ramdrv%\etc\profile\%g_profile%.net goto _noprf1
type %ramdrv%\etc\profile\%g_profile%.net >>%tmp%\_msnetx.bat
echo MSNET: %ramdrv%\etc\profile\%g_profile%.net found
:_noprf1
if not "%p_prot%"=="mstcp" goto _notlan
echo.
echo MSNET: Type "ipconfig" to view TCP/IP settings...
if not exist %ramdrv%\etc\autoexec.net echo MSNET: Type "msnet" to connect a drive to a network share...
goto _notlan
:_notlan
if "%g_profile%"=="" goto _no2prf1
if not exist %ramdrv%\etc\profile\%g_profile%.bat goto _no2prf1
type %ramdrv%\etc\profile\%g_profile%.bat >>%tmp%\_msnetx.bat
echo MSNET: %srcdrv%\etc\profile\%g_profile%.bat found
:_no2prf1
if 1==1 goto _end
:_savpro
call w.bat box @%0:w_proname
if errorlevel 2 goto _save
if not exist %ramdrv%\etc\profile\%g_profile%.pro goto _savecfg
call w.bat box @%0:w_pwrite
if errorlevel 2 goto _save
:_savecfg
set wrb=%p_nicmode%
set wcb1=%p_tcpwin%
set wcb2=%p_idwin%
set wcb3=%w_savepw%
call w.bat box @%0:w_savecfg
set p_nicmode=%wrb%
set p_tcpwin=%wcb1%
set p_idwin=%wcb2%
set w_savepw=%wcb3%
if errorlevel 2 goto _savpro
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _save
echo MSNET: Saving profile "%g_profile%"
set | tfind /f1,2 "P_">%tmp%\_msnet.tmp
if not "%w_savepw%"=="1" goto _jhgsgq
echo W_PASSWD=%w_passwd%>>%tmp%\_msnet.tmp
:_jhgsgq
type %tmp%\_msnet.tmp | lmod /L* []>%tmp%\_msnet.bat
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
if not exist %srcdrv%\etc\profile\*.* mkdir %srcdrv%\etc\profile
type %tmp%\_msnet.bat>%srcdrv%\etc\profile\%g_profile%.pro
type %tmp%\_msnet.bat>%ramdrv%\etc\profile\%g_profile%.pro
echo MSNET: Configuration saved to %ramdrv%\etc\profile\%g_profile%.pro
echo.
@rem pause
goto _save
:_help
wbat box @%0:w_help
goto _save
:_config2
echo MSNET: Network services already loaded, going "config"
:_config1
echo :w_config "MSNET config" [x]>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
echo [ Global ] Global settings, autoexec.net, lmhosts>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
echo [ Profile ] Edit, delete profiles>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
if not exist protman$ goto _noprotm
echo [ Map ] Connect drive to network share>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
echo [ Relogon ] Logon as a different user>>%tmp%\_msnet.tmp
echo.>>%tmp%\_msnet.tmp
:_noprotm
echo [? Exit ] Exit>>%tmp%\_msnet.tmp
call w.bat box @%tmp%\_msnet.tmp:w_config
if errorlevel 100 goto _end
if "%wbat%"=="Global" goto _chgglo
if "%wbat%"=="Profile" goto _chgpro
if "%wbat%"=="Map" goto _mapdrv
if "%wbat%"=="Relogon" goto _relogon
echo MSNET: w_config value "%wbat%" not found
goto _abort
:_mapdrv
if "%w_path%"=="" set w_path=\\server\share
call w.bat box @%0:w_map
if errorlevel 100 goto _config1
echo %w_drv% |lmod set w_drv=[$1 L]>%tmp%\_msnet.bat
echo %ramdrv% |lmod set ramdrv=[$1 L]>>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
if "%w_drv%:"=="%ramdrv%" goto _baddrv
echo MSNET: Connecting drive %w_drv%: to %w_path%...
%ramdrv%\net\net use %w_drv%: %w_path% /savepw:no /yes
if errorlevel 1 if not errorlevel 95 goto _abort
if not "%wcb1%"=="1" goto _norec
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _config1
echo MSNET: Adding mapping to %ramdrv%\etc\autoexec.net
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
echo @echo Connecting drive %w_drv%: to %w_path%...>>%ramdrv%\etc\autoexec.net
echo @%ramdrv%\net\net use %w_drv%: %w_path% /savepw:no /yes>>%ramdrv%\etc\autoexec.net
echo @if errorlevel 1 pause>>%ramdrv%\etc\autoexec.net
:_dummy55
if exist %srcdrv%\etc\autoexec.net del %srcdrv%\etc\autoexec.net >nul
if exist %ramdrv%\etc\autoexec.net copy %ramdrv%\etc\autoexec.net %srcdrv%\etc\autoexec.net >nul
:_norec
goto _config1
:_baddrv
echo MSNET: You cannot use drive %w_drv%:, it's in use by the ramdrive...
echo.
@rem pause
goto _mapdrv
:_relogon
call w.bat box @%0:w_relogon
if errorlevel 100 goto _config1
echo MSNET: logging off
net logoff /yes
if errorlevel 1 if not errorlevel 95 goto _abort
goto _logon
:_chgpro
if exist %ramdrv%\etc\profile\*.pro goto _prosel
echo MSNET: No profiles found...
echo You can save to a profile using the save button in the identification dialog
echo.
@rem pause
goto _config1
:_prosel
echo :_profile " Select profile to change " >%tmp%\_msnet.tmp
if exist %tmp%\_msnet2.tmp del %tmp%\_msnet2.tmp
for %%i in (%ramdrv%\etc\profile\*.pro) do echo %%i >>%tmp%\_msnet2.tmp
type %tmp%\_msnet2.tmp | lmod /L* /B\. [$4] >%tmp%\_msnet.bak
if exist %tmp%\_msnet2.tmp del %tmp%\_msnet2.tmp
:_dummy70
type %tmp%\_msnet.bak >>%tmp%\_msnet.tmp
call w.bat list @%tmp%\_msnet.tmp:_profile
if errorlevel 100 goto _config1
set w_profile=%wbat%
:_edtpro
call w.bat box @%0:w_chgpro
if errorlevel 4 goto _config1
if errorlevel 3 goto _delpro
if errorlevel 2 goto _netpro
if errorlevel 1 goto _editpro
goto _save
:_editpro
edit %ramdrv%\etc\profile\%w_profile%.pro
:_dummy87
if exist %srcdrv%\etc\profile\%w_profile%.pro del %srcdrv%\etc\profile\%w_profile%.pro >nul
if exist %ramdrv%\etc\profile\%w_profile%.pro copy %ramdrv%\etc\profile\%w_profile%.pro %srcdrv%\etc\profile\%w_profile%.pro >nul
if exist %srcdrv%\etc\profile\%w_profile%.net del %srcdrv%\etc\profile\%w_profile%.net >nul
if exist %ramdrv%\etc\profile\%w_profile%.net copy %ramdrv%\etc\profile\%w_profile%.net %srcdrv%\etc\profile\%w_profile%.net >nul
goto _edtpro
:_netpro
edit %ramdrv%\etc\profile\%w_profile%.net
:_dummy87
if exist %srcdrv%\etc\profile\%w_profile%.pro del %srcdrv%\etc\profile\%w_profile%.pro >nul
if exist %ramdrv%\etc\profile\%w_profile%.pro copy %ramdrv%\etc\profile\%w_profile%.pro %srcdrv%\etc\profile\%w_profile%.pro >nul
if exist %srcdrv%\etc\profile\%w_profile%.net del %srcdrv%\etc\profile\%w_profile%.net >nul
if exist %ramdrv%\etc\profile\%w_profile%.net copy %ramdrv%\etc\profile\%w_profile%.net %srcdrv%\etc\profile\%w_profile%.net >nul
goto _edtpro
:_delpro
call w.bat box @%0:w_delpro
if errorlevel 2 goto _edtpro
del %srcdrv%\etc\profile\%w_profile%.*
del %ramdrv%\etc\profile\%w_profile%.*
echo MSNET: Profile "%w_profile%" deleted.
echo.
@rem pause
goto _config1
:_chgglo
call w.bat box @%0:w_chgglo
if errorlevel 4 goto _config1
if errorlevel 3 goto _netlmh
if errorlevel 2 goto _netglo
if errorlevel 1 goto _setglo
goto _save
:_netglo
if exist %ramdrv%\etc\autoexec.net goto _netglo1
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _chgglo
echo MSNET: autoexec.net does not exist, creating a sample file...
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
echo rem Bart's Network boot disk - autoexec.net file>%ramdrv%\etc\autoexec.net
echo rem>>%ramdrv%\etc\autoexec.net
echo rem Use this batch file for your global drive mappings or to start any>>%ramdrv%\etc\autoexec.net
echo rem application you want.>>%ramdrv%\etc\autoexec.net
echo rem Example:>>%ramdrv%\etc\autoexec.net
echo rem net use f: \\server\share>>%ramdrv%\etc\autoexec.net
:_dummy56
if exist %srcdrv%\etc\autoexec.net del %srcdrv%\etc\autoexec.net >nul
if exist %ramdrv%\etc\autoexec.net copy %ramdrv%\etc\autoexec.net %srcdrv%\etc\autoexec.net >nul
:_netglo1
edit %ramdrv%\etc\autoexec.net
:_dummy66
if exist %srcdrv%\etc\autoexec.net del %srcdrv%\etc\autoexec.net >nul
if exist %ramdrv%\etc\autoexec.net copy %ramdrv%\etc\autoexec.net %srcdrv%\etc\autoexec.net >nul
if exist %srcdrv%\etc\lmhosts del %srcdrv%\etc\lmhosts >nul
if exist %ramdrv%\etc\lmhosts copy %ramdrv%\etc\lmhosts %srcdrv%\etc\lmhosts >nul
goto _chgglo
:_netlmh
if exist %ramdrv%\etc\lmhosts goto _netlmh1
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _chgglo
echo MSNET: lmhosts does not exist, creating a sample file...
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
echo # Bart's Network boot disk - LMHOSTS file>%ramdrv%\etc\lmhosts
echo #>>%ramdrv%\etc\lmhosts
echo # Sample line:>>%ramdrv%\etc\lmhosts
echo # 192.168.0.10 server1>>%ramdrv%\etc\lmhosts
echo.>>%ramdrv%\etc\lmhosts
:_netlmh1
edit %ramdrv%\etc\lmhosts
:_dummy66
if exist %srcdrv%\etc\autoexec.net del %srcdrv%\etc\autoexec.net >nul
if exist %ramdrv%\etc\autoexec.net copy %ramdrv%\etc\autoexec.net %srcdrv%\etc\autoexec.net >nul
if exist %srcdrv%\etc\lmhosts del %srcdrv%\etc\lmhosts >nul
if exist %ramdrv%\etc\lmhosts copy %ramdrv%\etc\lmhosts %srcdrv%\etc\lmhosts >nul
goto _chgglo
:_setglo
set wcb1=%g_fixpro%
set wcb2=%g_bypro%
set wcb3=%g_nocfg%
call w.bat box @%0:w_global
set g_fixpro=%wcb1%
set g_bypro=%wcb2%
set g_nocfg=%wcb3%
if errorlevel 2 goto _chgglo
echo MSNET: Saving global settings
set | tfind /f1,2 "G_"> %tmp%\_msnet.tmp
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
if not exist %ramdrv%\etc\global.set goto _yglob
xgrep -syv "^[:s]*@*[:s]*s?e?t?[:s]*G_.+=" %ramdrv%\etc\global.set >> %tmp%\_msnet.tmp
:_yglob
type %tmp%\_msnet.tmp > %srcdrv%\etc\global.set
type %tmp%\_msnet.tmp > %ramdrv%\etc\global.set
if not exist %srcdrv%\etc\global.set goto _gloerr1
echo MSNET: Global settings saved to "%ramdrv%\etc\global.set"
echo.
@rem pause
:_dummy66
if exist %srcdrv%\etc\autoexec.net del %srcdrv%\etc\autoexec.net >nul
if exist %ramdrv%\etc\autoexec.net copy %ramdrv%\etc\autoexec.net %srcdrv%\etc\autoexec.net >nul
if exist %srcdrv%\etc\lmhosts del %srcdrv%\etc\lmhosts >nul
if exist %ramdrv%\etc\lmhosts copy %ramdrv%\etc\lmhosts %srcdrv%\etc\lmhosts >nul
goto _chgglo
:_gloerr1
echo MSNET: Error saving global settings
echo.
@rem pause
goto _setglo
:w_delpro "Delete profile?" [x]
About to delete profile "%w_profile%"
Are you sure?
[ Yes ] [? No ]
::
:w_chgpro "Profile settings" [x]
Selected profile: %w_profile%
[ Edit ] Edit profile using a text editor (advanced)
[ Batch ] Edit the profile batch file using a text editor
[ Delete ] Delete this profile
[? Back ] Go back
::
:w_chgglo "Global settings" [x]
[ Settings ] Change global settings
[ Autoexec.net ] Edit the global autoexec.net batch file
[ Lmhosts ] Edit lmhosts file
[? Back ] Go back
::
:w_global "Global settings" [x]
Timeout [$ g_timeout,3] seconds.
[!] Use a fixed profile: [$ g_profile,8]
[!] No bypass
[!] Skip "Goto config?" dialog
[ Save ] [? Cancel ]
::
:w_param "Identification Settings" [x]
(~press any key~: #? sec.)
Logon as : [$ p_user,20,U ] Edit..
Password : [$ w_pass,14,P ] protocol.ini : [!]
Machine name(1): [$ p_mname,15,U] system.ini : [!]
Workgroup : [$ p_wrkgrp,15,U ] lmhosts : [!]
Domain (2): [$ p_ntdom,15,U] CPU speed : [$ p_slow,3]%
(1) When starting with "PC-" a random name will be used
(2) Requires full redirector and uses much more base memory
[ OK ] [ Save ] [ Help ] [ Abort ] [? Back ]
::
:w_tcp "TCP/IP Parameters" [x]
(~press any key~: #? sec.)
[!] Enable DHCP
IP address :*[$ p_ip,15! ]
Subnet Mask :*[$ p_subnet,15!]
Gateway :*[$ p_gway,15 ]
Wins Server :*[$ p_wins,15 ]
Name Server :*[$ p_dns,15 ]
DNS Suffix :*[$ p_domain,30 ]
[!] Load Packet Driver Interface
* Not used when DHCP enabled
[ OK ] [ Abort ] [? Back ]
::
:w_pwrite "Overwrite profile?" [x]
A profile with the name "%g_profile%"
already exists, overwrite?
[ Yes ] [? No ]
::
:w_proname "Enter profile name" [x]
Enter profile name: [$ g_profile,8]
[ OK ] [? Cancel ]
::
:w_savecfg "Save profile" [x]
Network adapter detection mode:
[.] Prompt [.] Auto [.] Manual [.] %p_nic%
[!] Skip TCP/IP parameter dialog
[!] Skip identification dialog
[!] Save password (in clear text, not secure!)
Dialog timeout [$ p_timeout,3] seconds.
(0 means disabled)
Configuration will be saved to:
%ramdrv%\etc\profile\%g_profile%
[ Ok ] [? Cancel ]
::
:w_bypro "Profile OK?" [x]
(~press any key~: #? sec.)
About to process
profile "%g_profile%"...
[ Ok ] [? Cancel ] [ Abort ]
::
:w_cfg "Continue or goto config?" [x]
(~press any key~: #? sec.)
Running Network Client...
[ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
If the disk in drive %srcdrv% is write
protected, please disable the write
protection now in order to save settings.
You can re-enable write protection after
saving.
[ Ok ] [? Cancel ]
::
:w_ramdrv "Where to store driver index files?" [x]
[ Ramdisk ] Copy to ramdisk (%ramdrv%)
[ Drive &A: ] If booted from Floppy choose to A:
[ Drive &B: ] If booted from CD-Rom choose to B:
Then create isoimage again with new
_msnet.pci, _msnet.txt and _msnet.crc
[? Cancel ] Don't copy
::
:w_relogon "Logon as a different user" [x]
Logon as : [$ p_user,20,U ]
Password : [$ w_pass,14,P ]
[ Ok ] [? Cancel ]
::
:w_map "Map drive" [x]
Drive : [$ w_drv,1,U! ]
Path : [$ w_path,30,! ]
[!] Reconnect at logon
[ Ok ] [? Cancel ]
::
:w_help "Help"
The help info has been removed
from the batchfile.
Please visit
http://www.nu2.nu/bootdisk/network/
for more information.
[ Ok ]
:_usage
echo Parameters:
echo -c Config mode
echo -h This help info
echo.
echo _end
:_error
shift
shift
echo.
echo MSNET: Error %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo.
echo MSNET: aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "P_" >%tmp%\_msnet.tmp
set | tfind /f1,2 "W_" >>%tmp%\_msnet.tmp
set | tfind /f1,2 "G_" >>%tmp%\_msnet.tmp
type %tmp%\_msnet.tmp | lmod /L* /B= set [$1]=>%tmp%\_msnet.bat
call %tmp%\_msnet.bat
if exist %tmp%\_msnet.* del %tmp%\_msnet.*
for %%i in (0 1 2 3 4) do set pci%%i=
for %%i in (1 2 3 4 5 6 7 8 9) do set wcb%%i=
for %%i in (wrb wbat ?) do set %%i=
cd %ramdrv%\
set _msnet=
set ?=
if exist %tmp%\_msnetx.bat %tmp%\_msnetx.bat
:_eof